<?php

namespace app\common\model;

use think\Model;
use think\Session;
use think\Db;

class UserFollow extends Model{
    protected $model_name = 'user_follow';

    public function checkFollow($fid){
        return Db::name($this->model_name)->where(['fid'=>$fid,'uid'=>Session::get('index_id')])->select();
    }



    /**
     * 用户id
     * @param $value
     * @return mixed
     */
    protected function setAuthorID($value)
    {
        return $value ? $value : Session::get('index_id');
    }

    /**
     * 创建时间
     * @return bool|string
     */
    protected function setCreateTimeAttr()
    {
        return date('Y-m-d H:i:s');
    }
}